﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Async="true" Inherits="baroIstatistik.test"  EnableViewState="false" EnableViewStateMac="false" ViewStateMode="Disabled" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body onload="kaldir()">
     
 <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" />
      
        <table style="height: 53px; width: 400px">
       <tr> <th>CocukID</th><th>İsim</th><th>Soyisim</th><th>yas</th><th>eğitim durumu</th></tr>
    <%
        
        
        try
        {



            baroIstatistik.Class.cocuk2 c = new baroIstatistik.Class.cocuk2();

            if (Request.QueryString["adi"]!=null)
            {
                c.Adi = Request.QueryString["adi"].ToString();
                c.Yasi = Convert.ToInt32(Request.QueryString["yasi"]);
                c.Egitim = Request.QueryString["egitim"].ToString();
                c.UserID = Convert.ToInt32(Request.QueryString["user"]);
            }

            if (Request.QueryString["bas"]!=null)
            {
                c.BasvuruID = Convert.ToInt32(Request.QueryString["bas"]);  
            }
            
            c.Baglamadurumu = 2;
            c.kaydet();






            System.Data.SqlClient.SqlConnection sqlcon = baroIstatistik.Class.connection.baglanti;
            System.Data.SqlClient.SqlCommand sqlcmd2 = new System.Data.SqlClient.SqlCommand("select * from cocuk where BasvuruID=@basvuruID", sqlcon);
            sqlcmd2.Parameters.AddWithValue("@basvuruID", c.BasvuruID);

            sqlcon.Open();
            System.Data.SqlClient.SqlDataReader sdr = sqlcmd2.ExecuteReader();

            while (sdr.Read())
            {


                c.Adi = sdr["adi"].ToString();
                c.Soyadi = sdr["soyadi"].ToString();
                c.Yasi = Convert.ToInt32(sdr["yasi"]);
                c.Egitim = sdr["egitim"].ToString();

                Response.Write("<tr><td><input type='button' value=sil onclick=cocuksil(" + sdr["cocukID"].ToString() + "); /> </td><td>" + c.Adi + "</td><td>" + c.Soyadi
                   + "</td><td>" + c.Yasi + "</td><td>" + c.Egitim + "</td></tr>");



            }




            sqlcon.Close();


        }
        catch (Exception)
        {


        }
        finally {

            this.ClientScript.RegisterClientScriptBlock(GetType(), "key", "kaldir();", true);
        
        }
         %>
            </table>


    </div>
    </form>
</body>
</html>
